#!/usr/local/bin/python3
# -*- coding: UTF-8 -*-
"""
@author:apple
@file:demo02.py
@time:2022/05/14
"""


def test01():
    ...
    name = "张三"
    print(name, id(name), type(name))
    print(len(name))
    print(int('110', base=2))
    content = '''
    函数
    '''
    print(content)

    print(name + content)
    print(5 * name)

    nums = [1, 2, 3]
    nums.append(4)
    print(nums)
    print(nums.pop(0))
    print(nums)


def test02():
    ...
    # 字符串 s 转 基本类型 float(x) int(x,base=2/10/16)
    # print(int('12.5'))
    print(float('12.5'))

    # 字符串与数字之间的转化
    # 数字转字符串，bin转二进制字符串，hex转16进制
    print(bin(10))
    print(hex(16))

    print(chr(65))
    print(ord('A'))

    print(str((1, 2, 3, 4)))
    print(str([1, 2, 3]))
    name = '张三'
    print(name[:])

    content = "name:{name},age:{age}".format(name='张三', age=21)
    print(content)
    print('#'.join(["1", '2', '3']))
    print(list('1,2,3,4'))
    print(list({'name': '张三', 'age': 21}))

    nums = [1, 2, 3, 4, 5]
    nums.extend((4, 5, 6))
    print(nums)

    print(1 in nums)
    print(not 1 in nums)
    print(1 not in nums)

    per = dict(name='张三', age=21)
    print(per)
    a, b, *c = nums
    print(a, b, c)
    c,d,*f = '哈哈哈阿斯顿'
    print(c,d,f)


if __name__ == '__main__':
    pass
    test02()
